OS := /home/rafael/mestrado/arp-workspace/sw/STANDALONE

TARGET	:= teste.x

SRCS	:= main.c lcd_driver.c lcd_driver.h
OBJS	:= $(SRCS:.c=.o)

include $(OS)/make.conf

.SILENT:

all: $(LINK_SCRIPT) $(ARCHC_SYSCALLS_LIB) $(OS_LIB) $(CRT0) $(OBJS)
	$(CC) $(CFLAGS) $(LFLAGS) -nostartfiles -o $(TARGET) $(OBJS) $(CRT0) $(LIB_DIR) $(LIBS)

clean:
	@rm -f *~ *.o *.x

distclean: clean

.S.o:
	$(CC) $(CFLAGS) $(INC_DIR) -c $<

.c.o:
	$(CC) $(CFLAGS) $(INC_DIR) -c $<

$(LINK_SCRIPT):
	$(error "ERROR: missing link script (link.ld)")

$(ARCHC_SYSCALLS_LIB):
	$(error "ERROR: missing ArchC Syscalls library (libac_sysc.a)")

$(OS_LIB):
	$(error "Error: missing OS Layer library (libos.a)")

$(CRT0):
	$(error "Error: missing processor startup object (start.o)")
